package com.witdata.config.aspect;


import com.witdata.common.domain.req.LoginRequest;
import com.witdata.config.aspect.service.LoginAsyncService;
import com.witdata.config.log.AsyncLoginLog;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Aspect
@Component
public class LoginAspect {
    @Autowired
    private LoginAsyncService loginAsyncService;  // 注入异步服务

    @AfterReturning("@annotation(asyncLoginLog) && args(loginRequest,..)")
    public void afterLogin(AsyncLoginLog asyncLoginLog, LoginRequest loginRequest) {
//        loginAsyncService.recordLoginInfoAsync(loginRequest); // 异步调用
    }
}